const express = require('express');
const router = express.Router();

router.get('/forSaleProformaInvoice', (req, res) => {
    const content = [];
    for(let i = 0; i < 100; i++)
        content.push({
            id: `2020${i}`,
            code: `2020${i}`,
            brandId: `00${i}`,
            brandCode: 'brandCode',
            brandName: 'brandName',
            dealerId: '001',
            dealerCode: 'dealerCode',
            dealerName: 'dealerName',
            currency: 1,
            tradeMethodId: 'tradeMethodId',
            tradeMethodCode: 'tradeMethodCode',
            tradeMethodName: 'tradeMethodName',
            paymentType: 1,
            transportType: 1,
            salesOrderPriceTerms: 1,
            countryOfOrigin: '中国',
            countryOfDestination: '美国',
            address: '重庆',
            contactNumber: '56465461',
            zipCode: '404000',
            productAmount: 65466465,
        });
    res.json({
        message: '',
        payload: {
            content,
            totalElements: 100,
        }
    });
});

router.get('/detail/forSaleProformaInvoice', (req, res) => {
    const details = [];
    for(let i = 0; i < 20; i++)
        details.push({
            id: `2020${i}`,
            sourceCode: 'sourceCode',
            productGroupId: `productGroupId${i}`,
            productGroupCode: `productGroupCode${i}`,
            productGroupName: `productGroupName${i}`,
            productCode: `productCode${i}`,
            productName: `productName${i}`,
            productId: `productId${i}`,
            productCategoryId: `productCategoryId${i}`,
            productCategoryCode: `productCategoryCode${i}`,
            productCategoryName: `productCategoryName${i}`,
            quantity: 456,
            containerNumber: 100,
            price: 131,
            totalPrice: 456454,
            taxFreePrice: 1232,
            taxFreeTotalPrice: 3123213,
            createTime: '2020-02-18T08:46:01.096Z',
            kDBomCode: 'kDBomCode',
            descriptionOfGoods: 'descriptionOfGoods'
        });
    res.json({
        message: '',
        payload: {
            details,
            totalElements: 20,
        }
    });
});

module.exports = router;
